package com.zhu.instructions.store;

import com.zhu.instructions.base.NoOperandsInstruction;
import com.zhu.rtda.Frame;
import com.zhu.rtda.InstanceOop;

/**
 * astore_0 指令
 * 将栈顶引用存入局部变量表索引 0 的位置
 */
public class ASTORE_0 extends NoOperandsInstruction {
    @Override
    public void execute(Frame frame) {
        InstanceOop ref = (InstanceOop) frame.getOperandStack().popRef();
        frame.getLocalVars().setRef(0, ref);
    }
}

